classdef Basis < handle
  %BASIS Summary of this class goes here
  %   Detailed explanation goes here
  
  properties
    BasisVectors;
    Atoms;
  end
  
  properties(Dependent)
    NumAtoms;
    NumAtomsTotal;
    NumAtomTypes;
    AtomTypes;
    NumDimensions;
  end
  
  methods
    function bo = Basis(basisVectors, atoms)
      bo.BasisVectors = basisVectors;
      bo.Atoms = atoms;
    end

    function [numAtoms] = get.NumAtoms(co)
      numAtoms = zeros(co.NumAtomTypes, 1);
      for i = 1:co.NumAtomTypes
        index = find(strcmp(co.Atoms, co.AtomTypes(i)));
        numAtoms(i) = length(index);
      end
    end

    function [numDimensions] = get.NumDimensions(co)
      numDimensions = size(basisVectors, 1);
    end
    
    function [numAtomsTotal] = get.NumAtomsTotal(co)
      numAtomsTotal = size(co.BasisVectors, 1);
    end

    function [atomTypes] = get.AtomTypes(co)
      atomTypes = unique(co.Atoms);
    end

    function [numAtomTypes] = get.NumAtomTypes(co)
      numAtomTypes = length(co.AtomTypes);
    end

  end
  
  methods(Static)
    obj = create_hematite_rhombohedral();
    test();
    
  end
  
end

